﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Data.SqlClient;
using System.Configuration;

namespace CarServiseSite
{
    public partial class WorkType_Adminaspx : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button3_Click(object sender, EventArgs e)
        {
            try
            {
                ConnectionStringSettings css =
                    ConfigurationManager.ConnectionStrings["CarServiceConnectionString"];
                string ss = css.ConnectionString;
                SqlConnection conn = new SqlConnection(ss);
                conn.Open();
                SqlCommand cmd = new SqlCommand("InsServiceType", conn);
                cmd.CommandType = System.Data.CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@Name", TextBox11.Text);
                cmd.Parameters.AddWithValue("@Description", TextBox12.Text);

                cmd.ExecuteNonQuery();
                conn.Close();

                GridView3.DataBind();
            }
            catch (Exception)
            {
                ErrLabel.Text = "Непредвиденное исключение";
            }
        }
    }
}